here is a nested test
\if\value{totalpages\@roman{#1}}=#2
	ifbody 1
	ifbody 1
	ifbody 1
	\typeout{Total pages for Chapter #1 match auxilary file (#2)}
\else
	\ifodd\value{totalchapters}=#1
		ifbody 2
		ifbody 2
		ifbody 2

	\fi
	\typeout{Warning: total pages for Chapter #1 updated from \the\value{totalpages\@roman{#1}} to #2-- recompile to fix}

\fi
